#%RAML 1.0
title: API文档
version: v1
baseUri: http://wxtest.meifz.com/api/{version}
mediaType: application/json
types:
  ID:
    type: string
    description: 对象ID值
    example: 57e627441bf42a657034cb07
    pattern: ^[0-9a-fA-F]{24}$
  BindPhone: !include types/bindPhone.json
  GetBindPhoneCode: !include types/getBindPhoneCode.json
  GetPhoneCode: !include types/getPhoneCode.json
  UpdateUserInfo: !include types/updateUserInfo.json
  UpdatePhone: !include types/updatePhone.json
  CreateCouponReceive: !include types/createCouponReceive.json
  CreateOrder: !include types/createOrder.json
  CreateComment: !include types/createComment.json
  AppointOrder: !include types/appointOrder.json
  CreateShopcarts: !include types/createShopcarts.json
  UpdateShopcart: !include types/updateShopcart.json
  RemoveShopcarts: !include types/removeShopcarts.json
  CreateFavoriates: !include types/createFavoriates.json
  RemoveFavoriates: !include types/removeFavoriates.json
  CancelOrder: !include types/cancelOrder.json
  SerachProducts: !include types/serachProducts.json
  FetchWechatIncome: !include types/fetchWechatIncome.json
  PayOrder: !include types/payOrder.json
annotationTypes:
  handlerFunc: string
  groupBy: string
securitySchemes:
  JWT: !include securitySchemes/jwt.raml
securedBy: [JWT]
/auth:
  description: 用户授权
  /wechat:
    description: 微信授权
    /ticket:
      get:
        description: 获取微信jsapi_tikcket
        (handlerFunc): getWechatTicket
        (groupBy): auth
        securedBy: [null]
    /return:
      get:
        description: 微信授权回调
        (handlerFunc): getWechatReturn
        (groupBy): auth
        securedBy: [null]
    /redirect:
      get:
        description: 微信授权跳转
        (handlerFunc): getWechatRedirect
        (groupBy): auth
        securedBy: [null]
    /bindPhone:
      post:
        description: 绑定手机号号
        (handlerFunc): bindPhone
        (groupBy): auth
        securedBy: [null]
        body:
          application/json:
            type: BindPhone
            example: !include examples/bindPhone.req.json
  /code:
    description: 验证码
    /bindPhone:
      post:
        description: 获取绑定手机号验证码
        (handlerFunc): getBindPhoneCode
        (groupBy): auth
        securedBy: [null]
        body:
          application/json:
            type: GetBindPhoneCode
            example: !include examples/getBindPhoneCode.req.json
    /phone:
      post:
        description: 获取更改手机号用验证码
        (handlerFunc): getPhoneCode
        (groupBy): auth
        body:
          application/json:
            type: GetPhoneCode
            example: !include examples/getPhoneCode.req.json
  /phone:
    put:
      description: 更换手机
      (handlerFunc): updatePhone
      (groupBy): auth
      body:
        application/json:
          type: UpdatePhone
          example: !include examples/updatePhone.req.json
/user:
  description: 用户
  /info:
    get:
      description: 获取用户信息
      (handlerFunc): getUserInfo
      (groupBy): user
    put:
      description: 修改用户信息
      (handlerFunc): updateUserInfo
      (groupBy): user
      body:
        application/json:
          type: UpdateUserInfo
          example: !include examples/updateUserInfo.req.json
  /coupons:
    description: 优惠券列表
    get:
      description: 获取优惠券列表
      (handlerFunc): listCoupons
      (groupBy): coupon
  /coupon:
    description: 优惠券
    /{couponId}:
      uriParameters:
        couponId: ID
      /info:
        get:
          description: 获取优惠券信息
          (handlerFunc): getCouponInfo
          (groupBy): coupon
  /couponReceives:
    description: 领取的优惠券列表
    get:
      description: 领取的优惠券列表
      (handlerFunc): listCouponReceives
      (groupBy): couponReceive
  /couponReceive:
    description: 领取优惠券
    post:
      description: 领取优惠券
      (handlerFunc): createCouponReceive
      (groupBy): couponReceive
      body:
        application/json:
          type: CreateCouponReceive
          example: !include examples/createCouponReceive.req.json
  /orders:
    description: 订单列
    get:
      description: 获取订单列表
      (handlerFunc): listOrders
      (groupBy): order
  /order:
    description: 订单
    post:
      description: 新增订单
      (handlerFunc): createOrder
      (groupBy): order
      body:
        application/json:
          type: CreateOrder
          example: !include examples/createOrder.req.json
    /{orderId}:
      uriParameters:
        orderId: ID
      delete:
        description: 删除订单
        (handlerFunc): removeOrder
        (groupBy): order
      /info:
        get:
          description: 获取订单信息
          (handlerFunc): getOrderInfo
          (groupBy): order
      /cancel:
        put:
          description: 取消订单
          (handlerFunc): cancelOrder
          (groupBy): order
          body:
            application/json:
              type: CancelOrder
              example: !include examples/cancelOrder.req.json
      /pay:
        put:
          description: 支付订单
          (handlerFunc): payOrder
          (groupBy): order
          body:
            application/json:
              type: PayOrder
              example: !include examples/payOrder.req.json
      /appoint:
        put:
          description: 预约时间
          (handlerFunc): appointOrder
          (groupBy): order
          body:
            application/json:
              type: AppointOrder
              example: !include examples/appointOrder.req.json
  /comments:
    description: 评论列表
    get:
      description: 获取评论列表
      (handlerFunc): listComments
      (groupBy): comment
  /comment:
    description: 评论
    post:
      description: 新增评论
      (handlerFunc): createComment
      (groupBy): comment
      body:
        application/json:
          type: CreateComment
          example: !include examples/createComment.req.json
  /shopcarts:
    description: 购物车清单列表
    post:
      description: 新增购物车清单列表
      (handlerFunc): createShopcarts
      (groupBy): shopcart
      body:
        application/json:
          type: CreateShopcarts
          example: !include examples/createShopcarts.req.json
    get:
      description: 获取购物车清单列表
      (handlerFunc): listShopcarts
      (groupBy): shopcart
    delete:
      description: 批量删除购物车
      (handlerFunc): removeShopcarts
      (groupBy): shopcart
      body:
        application/json:
          type: RemoveShopcarts
          example: !include examples/removeShopcarts.req.json
  /favoriates:
    description: 收藏夹清单列表
    get:
      description: 获取收藏夹清单列表
      (handlerFunc): listFavoriates
      (groupBy): favoriate
    post:
      description: 批量创建收藏夹
      (handlerFunc): createFavoriates
      (groupBy): favoriate
      body:
        application/json:
          type: CreateFavoriates
          example: !include examples/createFavoriates.req.json
    delete:
      description: 批量创建收藏夹
      (handlerFunc): removeFavoriates
      (groupBy): favoriate
      body:
        application/json:
          type: RemoveFavoriates
          example: !include examples/removeFavoriates.req.json
/couponCharges:
  description: 充值优惠券模板
  get:
    description: 获取充值优惠券模板列表
    (handlerFunc): listCouponCharges
    (groupBy): couponCharge
    securedBy: [null]
/couponSyses:
  description: 系统发放优惠券列表
  get:
    description: 系统发放优惠券列表
    (handlerFunc): listCouponSyses
    (groupBy): couponSys
    securedBy: [null]
/shops:
  description: 店铺列表
  get:
    description: 获取店铺列表
    (handlerFunc): listShops
    (groupBy): shop
    securedBy: [null]
/shop:
  description: 店铺
  /{shopId}:
    uriParameters:
      shopId: ID
    /comments:
      description: 评论列表
      get:
        description: 获取评论列表
        (handlerFunc): listCommentByShopId
        (groupBy): comment
        securedBy: [null]
    /info:
      get:
        description: 获取店铺信息
        (handlerFunc): getShopInfo
        (groupBy): shop
        securedBy: [null]
/cats:
  description: 商品类目列表
  # /root:
  #   get:
  #     description: 获取商品根类目列表
  #     (handlerFunc): listRootCats
  #     (groupBy): cat
  #     securedBy: [null]
  /all:
    get:
      description: 获取所有类目
      (handlerFunc): listAllCats
      (groupBy): cat
      securedBy: [null]
/cat:
  description: 单个商品类目
  /{catId}:
    uriParameters:
       catId: ID
    /products:
      get:
        description: 获取某类目下的产品列表
        (handlerFunc): listProductsByCatId
        (groupBy): product
        securedBy: [null]
    /attrs:
      get:
        description: 获取某品类下的属性集列表
        (handlerFunc): listCatAttrs
        (groupBy): catAttr
        securedBy: [null]
/products:
  description: 产品
  get:
    description: 获取多个产品
    (handlerFunc): listProducts
    (groupBy): product
    securedBy: [null]
/product:
  description: 单个产品
  /{productId}:
    uriParameters:
      productId: ID
    /info:
      get:
        description: 获取产品信息
        (handlerFunc): getProductInfo
        (groupBy): product
        securedBy: [null]
/schedules:
  get:
    description: 获取预约日程
    (handlerFunc): getSchedules
    (groupBy): schedule
/scheduleScheme:
  get:
    description: 获取预约方案
    (handlerFunc): getScheduleSchemes
    (groupBy): scheduleScheme
    securedBy: [null]
/banner:
  get:
    description: 获取商城首页
    (handlerFunc): getSysBanner
    (groupBy): banner
    securedBy: [null]
/bills:
  description: 账单列表
  get:
    description: 获取账单列表
    (handlerFunc): listBills
    (groupBy): bill
/bill:
  description: 账单
  /{billid}:
    uriParameters:
      billid: ID
    get:
      description: 获取账单详情
      (handlerFunc): getBillInfo
      (groupBy): bill
/balance:
  get:
    description: 查看账户余额
    (handlerFunc): getBalanceInfo
    (groupBy): bill
/incomes:
  description: 充值单列表
  get:
    description: 获取充值单列表
    (handlerFunc): listIncomes
    (groupBy): income
/income:
  description: 充值单
  /{tradeId}:
    uriParameters:
      tradeId: ID
    get:
      description: 获取充值单详情
      (handlerFunc): getIncomeInfo
      (groupBy): income
  /wechat:
    description: 微信充值
    post:
      description: 获取微信预充值数据
      (handlerFunc): fetchWechatIncome
      (groupBy): income
      body:
        application/json:
          type: FetchWechatIncome
          example: !include examples/fetchWechatIncome.req.json
/qiniu:
  description: 七牛
  /token:
    post:
      description: 请求七牛token
      (handlerFunc): requestQiniuToken
      (groupBy): qiniu
      securedBy: [null]
/actives:
  description: 活动页面模板
  get:
    description: 获取活动页面模板列表
    (handlerFunc): listActives
    (groupBy): active
    securedBy: [null]
/active:
  description: 活动页面模板
  /{activeId}:
    uriParameters:
      activeId: ID
    /info:
      get:
        description: 获取活动页面模板信息
        (handlerFunc): getActiveInfo
        (groupBy): active
        securedBy: [null]
